/**
 * 
 */
package photosalvage.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Version;

import org.hibernate.annotations.Index;

/**
 * @author shumpei
 *
 */
@Entity
@Table(name="PLACE")
@org.hibernate.annotations.Table(
		appliesTo="PLACE",
		indexes={@Index(name="IDX_PLACE_NUM",columnNames="NUM")})
public class Place {
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE)
	private Long id;
	
	@Column(name="NUM", nullable=false, length=8)
	private String number;
	
	@OneToMany(mappedBy="place")
	private List<Owner> people;
	
	@Version
	private Long version;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}
	public void setNumber(String number) {
		this.number = number;
	}

	public List<Owner> getPeople() {
		return people;
	}
	public void setPeople(List<Owner> people) {
		this.people = people;
	}
	public Long getVersion() {
		return version;
	}
	public void setVersion(Long version) {
		this.version = version;
	}
}
